@model RolesIndexViewModel
@using Orchard.Roles.ViewModels;
@using Orchard.Utility.Extensions;
@{
    Script.Require("ShapesBase");

    Layout.Title = T("Roles").ToString();
}

@using(Html.BeginFormAntiForgeryPost()) {
    @Html.ValidationSummary();
    <fieldset class="bulk-actions">
        <label for="publishActions">@T("Actions:")</label>
        <select id="Select1" name="roleActions">
            <option value="1">@T("Delete")</option>
        </select>
        <button type="submit">@T("Apply")</button>
    </fieldset>
    <div class="manage">@Html.ActionLink(T("Add a role").ToString(), "Create", new { }, new { @class = "button primaryAction" })</div>
    <fieldset>
        <table class="items" summary="@T("This is a table of the roles currently available for use in your application.")">
            <colgroup>
                <col id="Col1" />
                <col id="Col2" />
                <col id="Col3" />
            </colgroup>
            <thead>
                <tr>
                    <th scope="col">&nbsp;&darr;</th>
                    <th scope="col">@T("Name")</th>
                    <th scope="col"></th>
                </tr>
            </thead>
            @foreach (var row in Model.Rows) {
                <tr>
                    <td><input type="checkbox" value="true" name="@("Checkbox." + row.Id)"/></td>
                    <td>@Html.ActionLink(row.Name, "Edit", new { row.Id })</td>
                    <td>
                        @Html.ActionLink(T("Edit").ToString(), "Edit", new { row.Id })
                        @if (row.Name != "Administrator") {
                            @T(" | ")
                            <a href="@Url.Action("Delete", new {row.Id, returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString()})" itemprop="RemoveUrl UnsafeUrl">@T("Delete")</a>                       
                        }
                    </td>
                </tr>
            }
        </table>
    </fieldset>
}